package com.ruoyi.framework.aspectj;

import com.ruoyi.framework.aspectj.commonservice.TraceIdHandlerInterceptor;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * 拦截器配置类.
 *
 * @date 2022/10/10 16:33
 */
@Component
public class MvcHandlerInterceptor implements WebMvcConfigurer {

    @Resource
    private TraceIdHandlerInterceptor traceIdHandlerInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(this.traceIdHandlerInterceptor).addPathPatterns("/**").order(1);
    }
}
